<me:UIPRNDEF x:Class="WPFExcelReport.TPRNDEF"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                     xmlns:PT="clr-namespace:WPFExcelReport;assembly=TICC_PCTYPE"   
                    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"   
                    xmlns:KDF="clr-namespace:WPFExcelReport;assembly=TKUNDFORM"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIPRNDEF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIPRNDEF.Resources>
    <Grid> 
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="1" Margin="0,0,0.0,0">
            <WrapPanel >
                <StackPanel>
                    <Button Margin="15,0,0,0" Width="20" Height="20" Click="SaveCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                 </StackPanel>
                <WrapPanel>
                    <Button Margin="15,0,0,0" Width="20" Height="20"   Click="cmdPRNExcel_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/excel_icon.jpg" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">从Excel转换</TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <Button Margin="15,0,0,0" Width="20" Height="20"   Click="NewCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">增加一行</TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <Button Margin="5,0,0,0" Width="20" Height="20"  Click="DeleteCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">删除格式</TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <Button Margin="15,0,0,0" Width="20" Height="20" Content="" Click="cmdPRNConvert_Click" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Run.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center">输出PRN</TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <Button Margin="15,0,0,0" Width="20" Height="20" Click="PreviewCommand">
                        <Button.Background> 
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"><Run Text="{Binding Source={Localization:Translate Word=预览}}" /></TextBlock>
                </WrapPanel> 
            </WrapPanel>
            <WrapPanel>
                <Button Margin="5,0,0,0"  Width="20" Height="20" Click="CopyCommand">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                    </Button.Background>
                </Button>
                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">从此格式复制</TextBlock>
                <KDF:TSKD09  Name="cSKD09"/>
            </WrapPanel>
            <WrapPanel> 
                <TextBlock Width="50" Text="{Binding Path=ROWNID, Source={StaticResource ResourceKey=vwMaster}}"></TextBlock> 
                <TextBlock>格式名称</TextBlock>
                <TextBlock Text="{Binding Path=PRNAME, Source={StaticResource ResourceKey=vwMaster}}"></TextBlock>
                <TextBlock>图片在服务器目录</TextBlock>
                <TextBox Name="txtFileRoot" Width="Auto">E:\intex.nt\intex\db\texdb.dbs\format\PIC</TextBox>
            </WrapPanel>
            <WrapPanel>
                <PT:TSPCT dwPCT="{Binding dwPCT,ElementName=TV}"/>
                <TextBlock>内容</TextBlock>
                <PT:TSTPCT dwTPCT="{Binding dwTPCT,ElementName=TV}"/>
                <TextBlock   Width="Auto">上边</TextBlock> 
                <ex:NumericBox  Text="{Binding TOPY,ElementName=TV}" Width="40"/>
                <Button Name="btnLSX" Click="btnLSX_Click">左起</Button>
                <ex:NumericBox  Text="{Binding LSX,ElementName=TV}" Width="40"/>
                
                <Button Name="btnLMX" Click="btnLMX_Click">中间</Button>
                <ex:NumericBox  Text="{Binding LMX,ElementName=TV}" Width="40"/> 
                <Button Name="btnLINESet" Click="btnLINESet_Click">定行</Button>
                <Button Name="btnLINE" Click="btnLINE_Click">增加一行</Button>
                <ex:NumericBox  Text="{Binding LINE,ElementName=TV}" Width="40"/>
                <ex:NumericBox  Text="{Binding LHEIGHT,ElementName=TV}" Width="40"/> 
            </WrapPanel>
        </StackPanel> 
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"/> 
            </Grid.ColumnDefinitions>
            <Image Name="imgpriew"   Grid.Column="1"  Width="400" Height="300"   Stretch="Fill" StretchDirection="Both"   VerticalAlignment="Top" Margin="0,0" />
            <DataGrid  Grid.Column="0"  
                      Name="dlgMaster"
                      IsReadOnly="True"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="False"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"
                       IsSynchronizedWithCurrentItem="True"
                              MaxHeight="700"
                                VerticalAlignment="Top"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0.0,0,0.0,0"  
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=PRDES}" Header="{Binding Source={Localization:Translate Word=状态}}"  Width="Auto" MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=PRCOND}" Header="{Binding Source={Localization:Translate Word=行}}"  Width="Auto" MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=PRCTYPE}" Header="{Binding Source={Localization:Translate Word=命令}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRCTYPDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=PRLX}" Header="{Binding Source={Localization:Translate Word=X}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRLY}" Header="{Binding Source={Localization:Translate Word=Y}}"  Width="Auto" MinWidth="40"/>
                    <!--DataGridTextColumn Binding="{Binding Path=PRRX}" Header="{Binding Source={Localization:Translate Word=X}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRRY}" Header="{Binding Source={Localization:Translate Word=Y}}"  Width="Auto" MinWidth="40"/-->
                    <DataGridTextColumn Binding="{Binding Path=PRLTHICK}" Header="{Binding Source={Localization:Translate Word=粗细}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRCONTENT, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=内容}}"  Width="Auto" MinWidth="120"/>
                    <DataGridTextColumn Binding="{Binding Path=PRCONTDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=PRFONT, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=字体}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRFONTSIZE}" Header="{Binding Source={Localization:Translate Word=大小}}" Width="40"/>
                </DataGrid.Columns>
            </DataGrid> 
        </Grid>
    </Grid>  
</me:UIPRNDEF>
